//
//  VideoCameraViewController.m
//  嘀嘀拍
//
//  Created by wangjia_01 on 16/2/25.
//  Copyright © 2016年 wangjia_01. All rights reserved.
//

#import "VideoCameraViewController.h"
#import "VideoCellOne.h"
static NSString *staticCell=@"VideoCellOne";
@interface VideoCameraViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (weak, nonatomic) IBOutlet UITableView *mListView;
@property (weak, nonatomic) IBOutlet UISegmentedControl *segment;

//可每个页面一个数据源 也可以集中数据源.
@property (nonatomic,strong)NSMutableArray *dataArray;

@end

@implementation VideoCameraViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _segment.selectedSegmentIndex=0;
    
    NSDictionary* selectedTextAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:15],
                                             NSForegroundColorAttributeName: [UIColor whiteColor]};
    [_segment setTitleTextAttributes:selectedTextAttributes forState:UIControlStateSelected];//设置文字属性
    
    NSDictionary* unselectedTextAttributes = @{NSFontAttributeName:[UIFont boldSystemFontOfSize:15],
                                               NSForegroundColorAttributeName: [UIColor whiteColor]};
    [_segment setTitleTextAttributes:unselectedTextAttributes forState:UIControlStateNormal];
    
    _segment.tintColor=[UIColor colorWithHexString:@"0060AD"];
    _segment.backgroundColor=[UIColor clearColor];
    
    _dataArray=@[].mutableCopy;
    _mListView.delegate=self;
    _mListView.dataSource=self;
    [_mListView registerNib:[UINib nibWithNibName:@"VideoCellOne" bundle:nil] forCellReuseIdentifier:staticCell];
    
    // Do any additional setup after loading the view.
}
- (IBAction)changeVedioSource:(id)sender {
    
    UISegmentedControl *segment=sender;
    switch (segment.selectedSegmentIndex) {
        case 0:
            DLog(@"碰撞小视频")
            break;
        case 1:
            DLog(@"小视频");
            break;
        case 2:
             DLog(@"正常记录");
            break;
        case 3:
            DLog(@"照片");
            break;
        case 4:
            DLog(@"我的记录");
            
            break;
            
        default:
            break;
    }

    
    
}

#pragma mark --UITableViewDelegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 2;

}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    VideoCellOne *oneCell=[tableView dequeueReusableCellWithIdentifier:staticCell forIndexPath:indexPath];
    return oneCell;
    

}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    //传输url进行视频播放
    [self.navigationController pushViewController:[UIViewController getClass:@"EditPicViewController"] animated:YES];


}



- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath
{

    return 160;
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{

    return 160;

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
